Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️🐛 [Trusted Types] Make createExtensionScript Trusted Types compatible #39163

Merged
merged 35 commits into from
Jul 12, 2023

Conversation

youssef-attia
Copy link
Contributor

This change updates AMP's createExtensionScript function to be Trusted Types compatible, partial fix to #37297. The function was directly setting the scriptElement.src to some variable url. This url is expected to fall under the cdn so we can restrict the host the url takes on to cdn.ampproject.org and return the url as being a TrustedScriptUrl.

youssef-attia and others added 2 commits June 16, 2023 17:20
♻️🐛 [Trusted Types] Make createExtensionScript Trusted Types compatible
@amp-owners-bot amp-owners-bot bot requested a review from erwinmombay June 16, 2023 18:39
@erwinmombay erwinmombay requested review from powerivq and ychsieh June 21, 2023 21:33
Copy link
Member

@erwinmombay erwinmombay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the percy failures are related to the localhost whitelisting, correct?

@erwinmombay erwinmombay merged commit 4414531 into ampproject:main Jul 12, 2023
eszponder pushed a commit to krzysztofequativ/amphtml that referenced this pull request Apr 22, 2024
…le (ampproject#39163)

* extension script tt compatible

* Update extension-script.js

* testing if base case works

* console log url

* allow consolelog

* fix console log exempt

* typo

* fix format

* updated cdn and allowlist

* linter

* add fonts to allowlist

* Lint and fix logic

* Update policy

* unused ignore statement

* policy pattern change

* lint

* checking if localhost sufficient

* typo

* get mode from win

* update comment

* adding font cdn

* check if test detection works

* reformat

* comment and policy change

* reverting to last passing visual test

* removing filename limitations

* change policy format

* linting and format changes

* move regex to top level constant

* typo

---------

Co-authored-by: Ecenaz Ozmen <ecenazo@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants